package com.jb.util;

import java.util.ArrayList;
import java.util.List;

public class Klass {
    Klass parent;
    List<Klass> children=new ArrayList<Klass>();
     public Klass getParent() {
         return parent;
     }
     public int getChildCount() {
         return children.size();
     }
     public Klass getChildAt(int i) {
         return children.get(i);
     }
     public int getIndexOfChild(Klass child) {
         return children.indexOf(child);
     }
     
     public void addChild(Class clazz) {
         children.add(new Klass(clazz));
     }
     
     String name;
     String packageName;
     Class clazz=null;
     
     public Klass(Class clazz) {
        this.clazz = clazz;
         name = clazz.getName().substring(clazz.getName().lastIndexOf(".")+1);
         packageName = clazz.getPackage().getName();
     }
     public String getClassName() {
         return this.clazz.getName();
     }
     public void setClassName(String className) {
         //nothing
     }
    public Klass(Package pkg) {
        name = pkg.getName();
        packageName = name.substring((name.lastIndexOf(".")));
    }
    
    public void setName(String param) {
        this.name = param;
    }

    public String getName() {
        return name;
    }

    public void setPackageName(String param) {
        this.packageName = param;
    }

    public String getPackageName() {
        return packageName;
    }
}

